//
//  CommendModel.m
//  Shengzhuli
//
//  Created by FXGuo on 2018/1/28.
//  Copyright © 2018年 kamangkeji. All rights reserved.
//

#import "CommendModel.h"
#import "CommendImageTextModel.h"

@implementation CommendModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.ID = [dict[@"id"] integerValue];
        self.backImage = dict[@"backImage"];
        self.personName = dict[@"personName"];
        self.personIntroduce = dict[@"personIntroduce"];
        self.joinDate = dict[@"joinDate"];
        self.likeCount = [dict[@"likeCount"] integerValue];
        self.likeStatus = dict[@"likeStatus"];
        NSMutableArray *arr = [NSMutableArray array];
        for (NSDictionary *imageDict in dict[@"atlasList"]) {
            CommendImageTextModel *model = [CommendImageTextModel objectWithDict:imageDict];
            [arr addObject:model];
        }
        self.atlasList = arr;
        self.yearMonth = dict[@"yearMonth"];
        self.day = dict[@"day"];
        self.title = dict[@"title"];
        self.shareUrl = dict[@"shareUrl"];
    }
    return self;
}

+ (instancetype)objectWithDict:(NSDictionary *)dict
{
    return [[CommendModel alloc]initWithDict:dict];
}

@end
